package com.joysuch.wwyt.patrol.service;

import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.patrol.entity.PatrolCheckPlan;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.patrol.entity.bean.PatrolCheckPlanBean;
import com.joysuch.wwyt.patrol.entity.vo.CheckPlanDetailVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zr
 * @since 2022-02-28
 */
public interface PatrolCheckPlanService extends IService<PatrolCheckPlan> {
    List<PatrolCheckPlan> getEfficientPlans();

    /**
     * 保存巡检计划
     *
     * @param planBean
     */
    void savePlan(PatrolCheckPlanBean planBean) throws ApiBusinessException;

    void updatePlan(PatrolCheckPlanBean planBean) throws ApiBusinessException;

    ResultBean checkPlanPage(Integer page, Integer size, String nameOrCode, Long responsibleDeptId,String statusName);

    /**
     * 根据计划id获取计划详情
     *
     * @param planId
     */
    CheckPlanDetailVo getPlanDetailById(Long planId);

    /**
     * 根据id关闭检查计划
     *
     * @param id
     * @param flag 0：将计划关闭  1：将计划开启
     * @return
     */
    ResultBean closeOrOpenPlan(Long id, String flag);

    /**
     * 根据id删除计划
     *
     * @param id
     * @return
     */
    ResultBean deletePlanById(Long id);

    Map<String, List<Long>> getPlanNameIdMapping(String planName);

    String getNameByTaskId(Long taskId);

    List<String> getAllName();

    List<String> getAllByName(String planName);

}
